
/**
 *
 * @Dec 拼接Get参数
 * @Author zpw
 * @Param:参数对象
 *
 **/
export const assembleSeachParams = (paramsObject) => {
  	var paramsGrafting = "";
	for(var item in paramsObject){
		paramsGrafting += item +'='+ paramsObject[item]+'&';
	}
	return paramsGrafting;
};

/**
 *
 * @Dec 拼接url参数(私有工具方法)
 * @Author zpw
 * @Param 
 *
 **/
export const urlGrafting = (path,param) => {
  	var pagePath = path,
		pageParams = assembleSeachParams(param);
	var url = pagePath+pageParams;
	var urlLen = url.length;
	return url.substring(0,urlLen-1);
};

/**
 *
 *获取地址栏制定参数
 *@author zpw
 *@param str
 *
 */
export const getUrlParam = (name) => {
  return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(window.location.href)||[,""])[1].replace(/\+/g,'%20'))||null;
};


export default {
  assembleSeachParams,
  getUrlParam
}